<?php
Yii::app()->clientScript->registerScriptFile($this->staticsPath."/frontend/js/jquery.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/global.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/index.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/css/font-awesome.min.css");
Yii::app()->clientScript->registerCssFile($this->staticsPath."/Font-Awesome-3.2.1/css/font-awesome.min.css");
Yii::app()->clientScript->registerScriptFile($this->staticsPath."/js/alert.js",CClientScript::POS_HEAD);

Yii::app()->clientScript->registerCss("CSS1","
    .cont_box img{
        height: 200px;
    }

   #loadings {
        left: 50%;
        position: absolute;
        top: 50%;
    }

");


?>
<style type="text/css">
    .main-box {
                height: 100%;
        left: 0;
        margin: 0 auto;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: -1;
    }
    .morcon {
        height: 100px;
        margin: 245px 20px 20px;
        position: relative;
        text-align: center;
    }

    .morcon .reg {
        background: rgba(255, 255, 255, 0) none repeat scroll 0 0;
        border: medium none;
        color: #fff;
        font-size: 20px;
        left: 4%;
        position: absolute;
        top: 0;
    }
    .morcon .login {
        background: rgba(255, 255, 255, 0) none repeat scroll 0 0;
        border: medium none;
        color: #fff;
        display: block;
        font-size: 20px;
        left: 51%;
        position: absolute;
        top: 39%;
    }

    .wrap .header{
        width: 100%;
        position: relative;
        height: 300px;
    }
    .wrap .footer {
        height: 300px;
        position: relative;
        width: 100%;
    }

    .wrap .header .mydodo{
        background: url("<?php echo $this->staticsPath."/img/mydodo.png" ?>") no-repeat scroll 0 0 / 150px auto;
        height: 40px;
        width: 150px;
        position: absolute;
        right: 15px;
        top: 25px;
    }
    .wrap .header .imgbg{
        background: url("<?php echo $this->staticsPath."/img/imgbg.png" ?>") no-repeat scroll 0 0 / 150px auto;
        height: 150px;
        width: 150px;
        position: absolute;
        left: 15px;
        top: 90px;
    }
    .imgbg .box{
        width: 100%;
        height: 100%;
        position: relative;
    }
    .imgbg .box img {
        border-radius: 50%;
        height: 80%;
        left: 15px;
        position: absolute;
        top: 15px;
        width: 80%;
    }
    .wrap .header .hname {
        height: 200px;
        left: 170px;
        position: absolute;
        top: 144px;
        width: 200px;
    }
    .wrap .header .hname p{
        color: #0066b3;
        font-size: 20px;
    }
    .wrap .header .list {


        height: 80px;
        left: 25px;
        position: absolute;
        top: 25px;
        width: 80px;
    }
    .wrap .header .list a{
        color: #0066b3;
        font-size: 30px;
    }
    .main-box {
        background: #380C05 url("<?php echo $this->staticsPath."/img/dhbg.png" ?>") no-repeat scroll 0 0 / 100% 100%;
        height: 100%;
        left: 0;
        margin: 0 auto;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: -1;
    }
    body{
        background-color: #380C05;
    }

    .header {
        position: fixed;
        top:0;
    }
    html,
    body,
    .data,
    .wrap {
        height: 100%;
    }

    .borders{
        width: 100%;
        position: relative;
        height: auto;
    }
    .borders .bg{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        border: 0;
    }
    .borders .tx{
        width: 30px;
        height: auto;
    }
    .borders .content {
        color: #555;
        font-size: 12px;
        padding: 11% 10px 15% 18%;
    }
    .borders .ptx{
        margin-top: 5px;
    }




    .imgbg .box{
        width: 100%;
        height: 100%;
        position: relative;
    }
    .imgbg .box img {
        border-radius: 50%;
        height: 80%;
        left: 15px;
        position: absolute;
        top: 15px;
        width: 80%;
    }
    .wrap .header_box {
        display: block;
        height: 220px;
        overflow: hidden;
        width: 100%;
    }
    .wrap .header_box .imgbg{

        height: 150px;
        width: 150px;
        position: absolute;
        left: 15px;
        top: 90px;
    }
    .wrap .header_box .hname {
        height: 125px;
        left: 170px;
        position: absolute;
        top: 15px;
        width: 135px;
    }
    .wrap .header_box .hcontent{
        height: 200px;
        left: 170px;
        position: absolute;
        top: 80px;
        width: 180px;
    }

    .wrap .content_box{
        height: 260px;
    }
    .wrap .header_box .hname p{
        color: #0066b3;
        font-size: 20px;
    }
    .wrap .header_box .list {


        height: 80px;
        left: 25px;
        position: absolute;
        top: 25px;
        width: 80px;
    }
    .wrap .header_box .list a{
        color: #0066b3;
        font-size: 30px;
    }
    .imgbox{
        padding: 25px;
    }
    .imgbox .box{
        float: left;
        width: 49%;
        height: 150px;
        position: relative;
    }
    .imgbox .box .list_box{

        height: 100%;
        width: 100%;
    }
    .imgbox .box .point1{
        background: url("<?php echo $this->staticsPath."/img/point1.png" ?>") no-repeat scroll 13px 0 / 130px auto;
        padding-left: 60px;
        padding-top: 66px;
    }
    .imgbox .box .point2{
        padding-left: 60px;
        padding-top: 42px;
        background: url("<?php echo $this->staticsPath."/img/point2.png" ?>") no-repeat scroll 13px 0 / 130px auto;
    }
    .imgbox .box .point3{
        padding-left: 60px;
        padding-top: 42px;
        background: url("<?php echo $this->staticsPath."/img/point3.png" ?>") no-repeat scroll 13px 0 / 130px auto;
    }
    .imgbox .box .point4{
        padding-left: 60px;
        padding-top: 60px;
        background: url("<?php echo $this->staticsPath."/img/point4.png" ?>") no-repeat scroll 13px 0 / 130px auto;
    }
    .imgbox .box .point5{
        padding-left: 60px;
        padding-top: 42px;
        background: url("<?php echo $this->staticsPath."/img/point5.png" ?>") no-repeat scroll 13px 0 / 130px auto;
    }
    .imgbox .box .point6{
        padding-left: 50px;
        padding-top: 30px;
        background: url("<?php echo $this->staticsPath."/img/point6.png" ?>") no-repeat scroll 13px 0 / 130px auto;
    }
    #loading {
        font-size: 30px;
        height: 50px;
        margin: 0 auto;
        text-align: center;
        width: 100px;
    }
    .alert-error {
        color: #b94a48;
    }
    .alert {
        border-radius: 4px;
        margin-bottom: 20px;
        padding: 8px 35px 8px 14px;
        text-align: center;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    .anniu{
        background: url("<?php echo $this->staticsPath."/img/anniu.png" ?>") no-repeat scroll 0 0 / 90px auto;
        height: 90px;
        margin-left: 23%;
        margin-top: 5%;
        width: 90px;
    }
    .hcontent {
        background: url("<?php echo $this->staticsPath."/img/dhbg1.png" ?>") no-repeat scroll 0 0 / 100% 100%;
        color: #b16e20;
        margin-left: -3%;
        margin-top: 7%;
        padding: 24px 41px 152px 56px;
        width: 94%;
    }
    .lz_box{
        background: url("<?php echo $this->staticsPath."/img/dhbg2.png" ?>") no-repeat scroll 0 0 / 50px auto;
        bottom: 0;
        height: 159px;
        position: fixed;
        right: 7px;
        width: 50px;
    }
    .quan_box{
        background: url("<?php echo $this->staticsPath."/img/dhbg3.png" ?>") no-repeat scroll 0 0 / 200px auto;
        height: 200px;
        left: 20px;
        position: absolute;
        top: 26px;
        width: 200px;
    }
    }
    .hcontent .dhtitle{
        font-size: 22px;
        text-align: center;

    }
    .hcontent .cont{
        font-size: 14px;
    }
    .hcontent .cont span {
        display: block;
    }

</style>

<div class="data" >
    <div class="main-box"></div>
<!--    <header class="homeHder header">-->
<!--        <a href="--><?php //echo $this->createUrl('index',array('openid'=>$openid)) ?><!--">-->
<!--        <div class="hder_return flol">-->
<!---->
<!--                <i class="size fa fa-angle-left"></i>-->
<!---->
<!--        </div>-->
<!--        </a>-->
<!--        <div class="hder_logo">积分兑换</div>-->
<!--    </header>-->
    <section class="wrap">
        <div class="header_box">
            <div class="quan_box"></div>
            <div class="hname">
                <p style="color: rgb(255, 255, 255); font-size: 22px; text-align: center;">面值：<?php echo $data['point'] ?></p>
                <div class="anniu" id="anniu"></div>
            </div>
        </div>
        <div class="content_box">
            <div class="hcontent">
                <div class="dhtitle">积分兑换说明</div>
                <div class="cont">
                    <span>1:每天签到领取1个积分</span>
                    <span>2:每发表或获得一则评论领取1个积分</span>
                    <span>3:获得教师的星级评论领取相应积分</span>
                    <span>4:每发表一篇读书心得领取10个积分</span>
                    <span>5:每月入阅读排行榜领取20个积分</span>
                    <span>积分兑换：</span>
                    <span>累积500积分兑换1张DODO券。</span>
                    <span>每学期期末根据DODO券的数量兑换相应的奖品。</span>

                </div>
            </div>
        </div>

    </section>
</div>
<div class="lz_box"></div>
<script type="text/javascript">
    $(function(){
        var zanlock = true;
        $("#anniu").click(function(){
            var _this = $(this);
            if(zanlock==true){
                $.ajax({
                    type: "POST",
                    url: '<?php echo Yii::app()->createUrl('user/ajaxExchange'); ?>',
                    data: {
                        id:'<?php echo $data['id'] ?>',
                    },
                    beforeSend:function(){
                        zanlock = false;
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data) {
                            zanlock=true;
                            if(data.status==1){
                                alert(data.message);

                            }else{
                                alert(data.message);
                            }
                        }else{
                            zanlock=true;
                            alert('兑换失败');
                        }
                    }
                });
            }
        });
    });
</script>
